package com.njwb.day08;

import java.util.Calendar;
import java.util.Date;

public class TestCalendar {
    public static void main(String[] args) {
        //日历
        //获得日历实例对象
        Calendar c=Calendar.getInstance();
        System.out.println(c);
        int year=c.get(Calendar.YEAR);
        System.out.println(year);
        int month=c.get(Calendar.MONTH+1);
        System.out.println(month);
        int day=c.get(Calendar.DAY_OF_MONTH);
        System.out.println(day);

        Date d=c.getTime();
        Date d2=new Date();
        System.out.println(d);
        System.out.println(d2);
    }
}
